package com.xci.xajtfb.bus.api;

import com.github.lvyanyang.annotation.Authorize;
import com.github.lvyanyang.core.BaseController;
import com.github.lvyanyang.core.BoolResult;
import com.github.lvyanyang.core.Const;
import com.github.lvyanyang.core.PageList;
import com.xci.xajtfb.bus.entity.WxComplaint;
import com.xci.xajtfb.bus.filter.WxComplaintFilter;
import com.xci.xajtfb.bus.service.WxComplaintService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 出租投诉信息表接口
 * @author 张谦 765870682@qq.com
 * @since 2021-03-02 9:40:00
 */
@Api(tags = "出租投诉信息表接口")
@Authorize
@RestController
@RequestMapping(value = "/api/bus/wxComplaint", produces = Const.PROJSON)
public class WxComplaintApiController extends BaseController {
    /**
     * 出租投诉信息表服务
     */
    @Resource
    private WxComplaintService wxComplaintService;

    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "新建出租投诉信息表")
    //@Authorize(code = "wxc.wxComplaint.insert")
    @PostMapping("/insert")
    public BoolResult insert(@RequestBody WxComplaint entity) {
        return wxComplaintService.insert(entity);
    }

    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "根据主键查询单个出租投诉信息表")
    @ApiImplicitParam(name = "id", value = "出租投诉信息表主键", required = true)
    //@Authorize(code = "wxc.wxComplaint.select")
    @PostMapping("/selectById")
    public BoolResult<WxComplaint> selectById(@PathVariable String id) {
        return BoolResult.success(wxComplaintService.selectById(id));
    }

    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "查询出租投诉信息表分页列表")
    //@Authorize(code = "wxc.wxComplaint.select")
    @PostMapping("/selectPageList")
    public BoolResult<PageList<WxComplaint>> selectPageList(@RequestBody WxComplaintFilter filter) {
        return BoolResult.success(wxComplaintService.selectPageList(filter));
    }
}
